package exercise03;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceI implements UserService {
    @Autowired
    private UserDao ud;
    public boolean toLogin(User u) {
        //dao的用户名与密码
        User user = ud.getUser();
        String lName = user.getLoginName();
        String pwd = user.getPassword();

        //获取传进来的用户名与密码
        String loginName = u.getLoginName();
        String password = u.getPassword();
        return lName.equals(loginName) && pwd.equals(password);
    }
}
